package lanqiaobei;
import java.util.HashSet;
import java.util.Scanner;
public class butonzichuan2 {
	public static void main(String[] args) {
        String str= "0100110001010001";
        HashSet<String> strings = new HashSet<>();

        String sur = "";

        for (int i = 0; i < str.length(); i++) {
            for (int j = i+1; j <= str.length(); j++) {
                sur = str.substring(i,j);
                strings.add(sur);
                }
            }

        System.out.println(strings.size());
    }
}
